import { request, config } from 'utils'

const { api } = config
const {iconUpload,addIcon,iconList,updateIcon,deleteIcon} = api

export async function upload (params) {
  return request({
    url: iconUpload,
    method: 'post',
    data: params,
    withoutToken: true,
    headers: { 'content-type': 'multipart/form-data' }
  })
}
export async function add (params) {
  return request({
    url: addIcon,
    method: 'post',
    data: params,
    withoutToken: true,
  })
}
export async function deleteIc (params) {
  return request({
    url: `${deleteIcon}/${params}`,
    method: 'post',
    data: params,
    withoutToken: true,
  })
}
export async function query (params) {
  return request({
    url: iconList,
    method: 'post',
    data: params,
    withoutToken: true,
  })
}
export async function update (params) {
  return request({
    url: updateIcon,
    method: 'post',
    data: params,
    withoutToken: true,
  })
}